#ifndef _PAGE_H 
#define _PAGE_H 

#include <map>
#include <vector>
#include <string>
#include <tr1/memory>

namespace jsearch
{

	struct term_info;
	class page_db;

	class page
	{
		public:
			page(int id, std::tr1::shared_ptr<page_db>& db);

			bool build_page_index();
			int get_count_max() const;
			int id() const;
			const std::map<std::string,term_info>& terms();

		private:
			struct Impl;
			std::tr1::shared_ptr<Impl> pimpl;
	};


	// term info
	struct term_info
	{
		term_info(int c=0, double f=0.0);
		int     count;
		double  freq;
	};

}
#endif
